<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ListExercicioTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:form styleClass="jsfcrud_list_form">
                <h:panelGroup id="messagePanel" layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                </h:panelGroup>
                <h:outputText escape="false" value="#{bundle.ListExercicioEmpty}" rendered="#{exercicioController.items.rowCount == 0}"/>
                <h:panelGroup rendered="#{exercicioController.items.rowCount > 0}">
                    <h:outputText value="#{exercicioController.pagination.pageFirstItem + 1}..#{exercicioController.pagination.pageLastItem + 1}/#{exercicioController.pagination.itemsCount}"/>&nbsp;
                    <h:commandLink action="#{exercicioController.previous}" value="#{bundle.Previous} #{exercicioController.pagination.pageSize}" rendered="#{exercicioController.pagination.hasPreviousPage}"/>&nbsp;
                    <h:commandLink action="#{exercicioController.next}" value="#{bundle.Next} #{exercicioController.pagination.pageSize}" rendered="#{exercicioController.pagination.hasNextPage}"/>&nbsp;
                    <h:dataTable value="#{exercicioController.items}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListExercicioTitle_idExercicio}"/>
                            </f:facet>
                            <h:outputText value="#{item.idExercicio}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListExercicioTitle_descricao}"/>
                            </f:facet>
                            <h:outputText value="#{item.descricao}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListExercicioTitle_maquina}"/>
                            </f:facet>
                            <h:outputText value="#{item.maquina}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="&nbsp;"/>
                            </f:facet>
                            <h:commandLink action="#{exercicioController.prepareView}" value="#{bundle.ListExercicioViewLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{exercicioController.prepareEdit}" value="#{bundle.ListExercicioEditLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{exercicioController.destroy}" value="#{bundle.ListExercicioDestroyLink}"/>
                        </h:column>
                    </h:dataTable>
                </h:panelGroup>
                <br />
                <h:commandLink action="#{exercicioController.prepareCreate}" value="#{bundle.ListExercicioCreateLink}"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.ListExercicioIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
